package com.fingard.dsp.bank.directbank.pab02.Util.api.utils;

import java.util.Random;

public class StringUtil {

	private static final String NULL = "null";

	private static final String EMPTY = "";

	/**
	 * 验证字符串是否等于空或等于null 或等于“null”
	 * 
	 * @param
	 * @return
	 */
	public static boolean isNull(String... srcs) {
		if (srcs == null || srcs.length == 0) {
			return true;
		}
		for (String src : srcs) {
			boolean isEmpty = EMPTY.equals(src);
			boolean isNull = NULL.equals(src);
			boolean isNull_S = src == null;
			return isEmpty || isNull || isNull_S;
		}
		return false;
	}
	/**
	 * 产生6位随机数
	 * 
	 * @param length
	 * @return
	 */
	public static String getRandomString(int length) { // length表示生成字符串的长度
		String base = "012345678917219219201177112919013737312109128173361631281190281";
		Random random = new Random();
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < length; i++) {
			int number = random.nextInt(base.length());
			sb.append(base.charAt(number));
		}
		return sb.toString();
	}
	



}
